package zoo;

import java.util.Scanner;

public class J09SungJuk {

	public static void main(String[] args) {
		// 메서드를 이용한 성적처리
		String name = "";
		int kor=0, eng=0, mat=0, tot=0;
		double avg =0;
		char grd= ' ';
		Scanner sc = null;
		String result = "";
		inputSungJuk(sc, name, kor, eng, mat);
		getTotal(tot, kor, eng, mat);
		getAverage(avg, tot);
		getGrade(avg, grd);
		System.out.println("name: "+name);
		System.out.println("kor: "+kor);
		System.out.println("eng: "+eng);
		System.out.println("mat: "+mat);
		System.out.println("tot: "+tot);
		System.out.println("avg: "+avg);
		System.out.println("grd: "+grd);
	}// main() END;

	public static void inputSungJuk(Scanner sc,String name,int kor, int eng, int mat/*매개변수목록*/) {
		sc = new Scanner(System.in);
		System.out.println("이름을 입력하세요");
		name = sc.next();
		System.out.println("국어점수를 입력하세요");
		kor = sc.nextInt();
		System.out.println("영어점수를 입력하세요");
		eng = sc.nextInt();
		System.out.println("수학점수를 입력하세요");
		mat = sc.nextInt();
		sc.close();
	}// inputSungJuk() END
	
	public static void getTotal(int tot, int kor, int eng , int mat){
		tot = kor+ eng+ mat;
	}//getTotal() END
	
	public static void getAverage(double avg, int tot){
		avg = (double)tot/3;	
	}//getAverage() END
	
	public static void getGrade(double avg, char grd){
		switch((int)avg/10){ //(int)avg 캐스트 연산자 사용해서 형변환 switch(정수만)
		case 10 :
		case 9 : grd = '수';break;
		case 8 : grd = '우';break;
		case 7 : grd = '미';break;
		case 6 : grd = '양';break;
		default: grd = '가';
		}//switchEND
		
	}//getGrade() END
}// class END;
